Database Management System
Q201.
A company maintains records of sales made by its salespersons and pays them commission based on each individual's total sales made in a year. This data is maintained in a table with following schema: salesinfo = (salespersonid, totalsales, commission) In a certain year, due to better business results, the company decides to further reward its salespersons by enhancing the commission paid to them as per the following formula: If commission \leq 50000, enhance it by 2% If 50000 < commission [latex]\leq 100000[/latex], enhance it by 4% If commission > 100000, enhance it by 6% The IT staff has written three different SQL scripts to calculate enhancement for each slab, each of these scripts is to run as a separate transaction as follows: T1 Update salesinfo Set commission = commission * 1.02 Where commission < = 50000; T2 Update salesinfo Set commission = commission * 1.04 Where commission > 50000 and commission is < = 100000; T3 Update salesinfo Set commission = commission * 1.06 Where commission > 100000; Which of the following options of running these transactions will update the commission of all salespersons correctlyQ202.
Consider the following schedules involving two transactions. Which one of the following statements is TRUE? S_1 :r_1(X); r_1(Y); r_2(X); r_2(Y); w_2(Y); w_1(X) S_2 :r_1(X); r_2(X); r_2(Y); w_2(Y); r_1(Y); w_1(X)Q203.
Consider the following two transactions : T1 and T2. T1:read (A); read (B); if A = 0 then B \leftarrow B + 1; write (B); T2 : read (B); read (A); if B \neq 0 then A \leftarrow A - 1; write (A); Which of the following schemes, using shared and exclusive locks, satisfy the requirements for strict two phase locking for the above transactions?Q204.
Consider the following schedule S of transactions T1 and T2:{\begin{array}{l|l} \textbf{T1}& \textbf{T2} \\\hline \text{Read(A)} \\ \text{A = A ? 10}\\ & \text{Read(A) }\\ & \text{Temp = 0.2*A} \\ & \text{Write(A)} \\ & \text{Read(B)} \\ \text{Write(A)}\\ \text{Read(B)}\\ \text{B = B + 10}\\ \text{Write(B)} \\ & \text{B = B + Temp} \\ & \text{Write(B)}\\ \end{array}}Which of the following is TRUE about the schedule S ?Q205.
Consider the following schema:Emp (Empcode, Name, Sex, Salary, Deptt)A simple SQL query is executed as follows: SELECT Deptt FROM Emp GROUP by Dept Having avg (Salary) > {select avg (Salary) from Emp}The output will beQ206.
Which of the following scenarios may lead to an irrecoverable error in a database system?Q207.
For the schedule given below, which of the following is correct:\begin{array}{lll} \text{1} & \text{Read A} & \text{} \\ \text{2} & \text{} & \text{Read B} \\ \text{3} & \text{Write A} & \text{} \\ \text{4} & \text{} & \text{Read A} \\ \text{5} & \text{} & \text{Write A} \\ \text{6} & \text{} & \text{Write B} \\ \text{7} & \text{Read B} & \text{} \\ \text{8} & \text{Write B} & \text{} \\\end{array}Q208.
Consider three data items D1,D2 and D3 and the following execution schedule of transactions T1,T2 and T3. In the diagram, R(D) and W(D) denote the actions reading and writing the data item D respectively. Which of the following statements is correct?Q209.
Let R and S be relational schemes such that R={a,b,c} and S={c}. Now consider the following queries on the database: I.\pi _{R-S}(r)-\pi_{R-S}(\pi_{R-S}(r) \times S -\pi_{R-S,S}(r)) II.\{t|t\in \pi _{R-S}(r)\wedge \forall u \in s (\exists v \in r(u=v[s]\wedge t=v[R-S]))\} III.\{t|t\in \pi _{R-S}(r)\wedge \forall v\in r(\exists u\in s(u=v[s]\wedge t=v[R-S]))\} IV. Select R.a, R.b From R,S Where R.c=S.c Which of the above queries are equivalent?Q210.
Consider the relation employee(name, sex, supervisorName) with name as the key. supervisorName gives the name of the supervisor of the employee under consideration. What does the following Tuple Relational Calculus query produce?